/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.com.cotelasa.scp.controlador;

import java.io.Serializable;
import javax.inject.Inject;
import javax.inject.Named;
import org.apache.log4j.Logger;
import org.springframework.context.annotation.Scope;
import pe.com.cotelasa.common.controlador.MBGenerico;
import pe.com.cotelasa.scp.common.IObserver;
import pe.com.cotelasa.scp.common.ISubject;
import pe.com.cotelasa.scp.controlador.backingBean.BKComponenteAddVentaDetalleND;

/**
 *
 * @author Jorge
 */
@SuppressWarnings("serial")
@Named(value = "MBComponenteAddVentaDetalleND")
@Scope("request")
public class MBComponenteAddVentaDetalleND extends MBGenerico implements ISubject, Serializable {

    private static Logger logger = Logger.getLogger(MBComponenteAddVentaDetalleND.class);
    @Inject
    private BKComponenteAddVentaDetalleND bkComponenteAddVentaDetalleND;
   
    
    public void cargaInicial(){
        bkComponenteAddVentaDetalleND.setDescripcion(null);
        bkComponenteAddVentaDetalleND.setTotal(0.0);
    }
    
    public void clearObserver() {
        bkComponenteAddVentaDetalleND.getObservers().clear();
    }

    @Override
    public void addObserver(IObserver observador) {
        bkComponenteAddVentaDetalleND.addObservers(observador);
    }

    @Override
    public void notificarObservadores() {
        for (IObserver observer : bkComponenteAddVentaDetalleND.getObservers()) {
            observer.actualizarObservador(bkComponenteAddVentaDetalleND);
        }
    }
}
